package ls.vuecp.gui.draw;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.AffineTransform;

import ls.vuecp.gui.component.LWComponent;

import tufts.vue.DEBUG;

public final class DrawContext 
{
	public final Graphics2D g;
	
    public final double zoom;
    
    public final float offsetX;
    public final float offsetY;
    
    public final Rectangle frame; 
    public final LWComponent focal;
    LWComponent focused;
    
    private final Shape rawClip;
    private final AffineTransform rawTransform;
    private final AffineTransform mapTransform;
    

	public DrawContext(Graphics _g, double zoom, float offsetX, float offsetY, 
			Rectangle frame, LWComponent focal, boolean absoluteLinks)
    {
        this.g = (Graphics2D) _g;
        this.zoom = zoom;
        this.offsetX = offsetX;
        this.offsetY = offsetY;
        this.frame = frame;
        this.focal = focal;

        this.rawClip = g.getClip();
        //this.g.translate(frame.x, frame.y);
        this.rawTransform = g.getTransform();
        this.g.translate(offsetX, offsetY);
        this.g.scale(zoom, zoom);
        this.mapTransform = g.getTransform();
        
//     	setMasterClip(g.getClip());

//		if (DEBUG.PAINT) out("CONSTRUCTED");
    }
}
